package config

import "github.com/spf13/viper"

var (
	MaxSize   int64 = 20 * 1024 * 1024
	Dir       string
	AppKey    string
	AppSecret string
	BaseUrl   string
)

func InitConfig() error {
	viper.SetConfigName("config")
	viper.SetConfigType("yaml")
	viper.AddConfigPath(".")
	if err := viper.ReadInConfig(); err != nil {
		return err
	}
	AppKey = viper.GetString("app_key")
	AppSecret = viper.GetString("app_secret")
	Dir = viper.GetString("dir")
	BaseUrl = viper.GetString("base_url")
	return nil
}
